public class Practice01 {
    public static void main(String[] args) {
        Student student = new Student();
        Student[] students = new Student[20];
        for (int i = 0; i < 20; i++) {
            student.random();
            students[i] = student;
        }
        System.out.println("输出2年级学生信息：");
        for (int i = 0; i < 20; i++) {
            if (students[i].state == 2) {
                System.out.println("学号：" + students[i].number + "\t年级：" + students[i].state + "\t分数：" + students[i].score);
            }
        }
        /*System.out.println("=== === ===");
        // 进行冒泡排序
        Student box = new Student();
        for (int a = 0; a < 20; a++) {
            for (int b = 0; b < 19; b++) {
                if (students[b].score > students[b + 1].score) {
                    box = students[b + 1];
                    students[b + 1] = students[b];
                    students[b] = box;
                }
            }
        }
        for (int c = 0; c < 20; c++) {
            System.out.println("学号：" + students[c].number + "\t年级：" + students[c].state + "\t分数：" + students[c].score);
        }*/
    }
}
